package cn.edu.gzist.chapter03.controller;

import jakarta.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;

@Controller
public class LoginController {

    @PostMapping("dologin")
    public String login(String username, String pwd, HttpSession session) {
        session.setAttribute("loginUser", username);
        System.out.println(username);
        System.out.println(pwd);

        return "redirect:index";
    }
}
